Subroutine calthp(temp)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Calculate Thermodynamic properties for every species !!
!! thp(isp,1)=Cp(T)/Ru
!! thp(isp,2)=Ho(T)/RuT
!! thp(isp,3)=So(T)/Ru
!! Cp(T): Heat capacity [kcal/mol-K]
!! Ho(T): Standard state enthalpy [kcal/mol]
!! So(T): Standard state entropy [kcal/mol-K]
!! Ru=0.001987 kcal/mol-K

	USE ckvar
	INTEGER :: i,isp
	REAL :: tmed,temp
	tmed=1000.0

	Ru=0.0019871

	DO isp=1,nspc
	if(temp.le.tmed) then
	i=8	!! for low temperature range
	elseif(temp.gt.tmed) then
	i=1	!! for high temperature range
	endif
	
	thp(isp,1)=thcef(isp,i) + thcef(isp,i+1)*temp + &
		   thcef(isp,i+2)*temp**2 + thcef(isp,i+3)*temp**3 + &
		   thcef(isp,i+4)*temp**4
	thp(isp,2)=thcef(isp,i) + thcef(isp,i+1)*temp/2 + &
		   thcef(isp,i+2)*temp**2/3 + &
		   thcef(isp,i+3)*temp**3/4 + &
		   thcef(isp,i+4)*temp**4/5 + &
		   thcef(isp,i+5)/temp
	thp(isp,3)=thcef(isp,i)*log(temp) + thcef(isp,i+1)*temp + &
		   thcef(isp,i+2)*temp**2/2 + thcef(isp,i+3)*temp**3/3 + &
		   thcef(isp,i+4)*temp**4/4 + thcef(isp,i+6)
!! thp(isp,1) -> Cp(T) [kJ/kmol-K]
!! thp(isp,2) -> Ho(T) [kJ/kmol]
!! thp(isp,3) -> So(T) [kJ/kmol-K]
!! Convert Unit: kcal -> J, mol -> kmol
	cpk(isp)=thp(isp,1)*Ru*4184100.0	! Cp(T) [J/kmol-K]
	hk(isp)=thp(isp,2)*Ru*temp*4184100.0 ! Ho(T) [J/kmol]
	sk(isp)=thp(isp,3)*Ru*4184100.0 ! So(T) [J/kmol-K]
	ENDDO
End subroutine
